package com.sky.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(description = "员工登录返回的数据格式")
public class EmployeeLoginVO implements Serializable {

    @ApiModelProperty("主键值")
    private Long id;

    @ApiModelProperty("用户名")
    private String userName;

    @ApiModelProperty("姓名")
    private String name;

    @ApiModelProperty("jwt令牌")
    private String token;



    // 私有构造函数，只能通过 Builder 构建对象
    private EmployeeLoginVO(Builder builder) {
        this.id = builder.id;
        this.userName = builder.userName;
        this.name = builder.name;
        this.token = builder.token;
    }

    // 提供静态方法获取 Builder 实例
    public static Builder builder() {
        return new Builder();
    }

    // Getters（根据需求添加，Setter 非必须）
    public Long getId() { return id; }
    public String getUserName() { return userName; }
    public String getName() { return name; }
    public String getToken() { return token; }

    // 静态内部 Builder 类
    public static class Builder {
        private Long id;
        private String userName;
        private String name;
        private String token;

        // 链式设置方法，返回 Builder 实例本身
        public Builder id(Long id) {
            this.id = id;
            return this;
        }

        public Builder userName(String userName) {
            this.userName = userName;
            return this;
        }

        public Builder name(String name) {
            this.name = name;
            return this;
        }

        public Builder token(String token) {
            this.token = token;
            return this;
        }

        // 最终构建方法
        public EmployeeLoginVO build() {
            // 可在此处添加参数校验逻辑（例如检查必填字段）
            return new EmployeeLoginVO(this);
        }
    }

    public void setId(Long id) {
        this.id = id;
    }


    public void setUserName(String userName) {
        this.userName = userName;
    }


    public void setName(String name) {
        this.name = name;
    }

    public void setToken(String token) {
        this.token = token;
    }
}
